3.19 \(\int \frac{\cos (x)}{2+2 \sin (x)+\sin ^2(x)} \, dx\)

Optimal. Leaf size=5 \[ \tan ^{-1}(\sin (x)+1) \]

[Out]

ArcTan[1 + Sin[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.026073, antiderivative size = 5, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3258, 617, 204} \[ \tan ^{-1}(\sin (x)+1) \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]/(2 + 2*Sin[x] + Sin[x]^2),x]

[Out]

ArcTan[1 + Sin[x]]

Rule 3258

Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + (b_.)*((f_.)*sin[(d_.) + (e_.)*(x_)])^(n_.) + (c_.)*((f_.)*sin[(d_.
) + (e_.)*(x_)])^(n2_.))^(p_.), x_Symbol] :> Module[{g = FreeFactors[Sin[d + e*x], x]}, Dist[g/e, Subst[Int[(1
 - g^2*x^2)^((m - 1)/2)*(a + b*(f*g*x)^n + c*(f*g*x)^(2*n))^p, x], x, Sin[d + e*x]/g], x]] /; FreeQ[{a, b, c,
d, e, f, n, p}, x] && EqQ[n2, 2*n] && IntegerQ[(m - 1)/2]

Rule 617

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[(a*c)/b^2]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + (2*c*x)/b], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{\cos (x)}{2+2 \sin (x)+\sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1}{2+2 x+x^2} \, dx,x,\sin (x)\right )\\ &=-\operatorname{Subst}\left (\int \frac{1}{-1-x^2} \, dx,x,1+\sin (x)\right )\\ &=\tan ^{-1}(1+\sin (x))\\ \end{align*}

Mathematica [A]  time = 0.0094799, size = 5, normalized size = 1. \[ \tan ^{-1}(\sin (x)+1) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/(2 + 2*Sin[x] + Sin[x]^2),x]

[Out]

ArcTan[1 + Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 6, normalized size = 1.2 \begin{align*} \arctan \left ( 1+\sin \left ( x \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(2+2*sin(x)+sin(x)^2),x)

[Out]

arctan(1+sin(x))

________________________________________________________________________________________

Maxima [A]  time = 1.45297, size = 7, normalized size = 1.4 \begin{align*} \arctan \left (\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2+2*sin(x)+sin(x)^2),x, algorithm="maxima")

[Out]

arctan(sin(x) + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.49945, size = 27, normalized size = 5.4 \begin{align*} \arctan \left (\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2+2*sin(x)+sin(x)^2),x, algorithm="fricas")

[Out]

arctan(sin(x) + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.257207, size = 5, normalized size = 1. \begin{align*} \operatorname{atan}{\left (\sin{\left (x \right )} + 1 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2+2*sin(x)+sin(x)**2),x)

[Out]

atan(sin(x) + 1)

________________________________________________________________________________________

Giac [A]  time = 1.1694, size = 7, normalized size = 1.4 \begin{align*} \arctan \left (\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(2+2*sin(x)+sin(x)^2),x, algorithm="giac")

[Out]

arctan(sin(x) + 1)